a12937d548bf886bc4ce96f6af2d1a04cd2eba93,modules/lang-painless/src/main/java/org/elasticsearch/painless/node/EComp.java,EComp,analyzeEq,#Locals#,77

Before Change


        left.analyze(variables);
        right.analyze(variables);

        Type promote = AnalyzerCaster.promoteEquality(left.actual, right.actual);

        if (promote == null) {
            throw createError(new ClassCastException("Cannot apply equals [==] to types " +

After Change


        left.analyze(variables);
        right.analyze(variables);

        promotedType = AnalyzerCaster.promoteEquality(left.actual, right.actual);

        if (promotedType == null) {
            throw createError(new ClassCastException("Cannot apply equals [==] to types " +
                "[" + left.actual.name + "] and [" + right.actual.name + "]."));
        }

        if (promotedType.sort == Sort.DEF) {
            left.expected = left.actual;
            right.expected = right.actual;
        } else {
            left.expected = promotedType;
            right.expected = promotedType;
        }